<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <script type="text/javascript" src="js/ajaxfileupload.js"></script>
	<script type="text/javascript" charset="utf-8" src="ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="ueditor/ueditor.all.js"> </script>
	<script type="text/javascript" charset="utf-8" src="ueditor/lang/zh-cn/zh-cn.js"></script>
    <div id="goods_discribe" style=" overflow: hidden;">
		<script id="goodsUE"  name="deContent" type="text/plain" style="width:800px;height:400px;margin: 0 auto "></script>
	</div>
	<div style="padding:5px ; text-align: center;">
			<a id="btn" class="easyui-linkbutton"  href="#"  >确认修改</a> 
			<a id="btn1" class="easyui-linkbutton"  href="#"  >加载原有数据</a>  
	</div>
<script type="text/javascript">
$(function(){
	var UEditor=UE.getEditor('goodsUE'); //实例化编辑器
	$('#btn').linkbutton({  
	    iconCls: 'icon-save',
	}); 
	$('#btn1').linkbutton({  
	    iconCls: 'icon-reload',
	}); 
	$('#btn').bind('click', function(){  //绑定提交数据按钮
		$.post("describe/updateDescribeInfoById",{gId:$('#goodsData').datagrid('getSelected').gId,deContent:UEditor.getContent()},function(data){
			if(data.status==200){
				$.messager.show({
					title:'成功提示',
					msg:'修改商品描述信息成功！',
					timeout:5000,
					showType:'slide'
				});
			}else{
				$.messager.alert('错误',data.data,'info');
			}
		});
	});
	$('#btn1').bind('click', function(){  
		$.post("describe/getDescribeInfoById",{id:$('#goodsData').datagrid('getSelected').gId},function(data){
			if(data.status==200){
				UEditor.setContent(data.data.deContent);
				
			}else{
				$.messager.alert('错误',data.data,'info');
			}
		});
	});
});

</script>